<template>
  <div class="searchHead">
 <el-input
    class="searchBox"
    placeholder="请输入搜索内容"
    prefix-icon="el-icon-search"
    v-model="searchVal">
  </el-input>
  <el-button type="success" @click="$emit('btnClick')" v-if="btnTitle!='不显示'">添加用户</el-button>
  </div>
</template>

<script>
  export default {
    props:['btnTitle','searchTitle'],
    data(){
      return{
        searchVal:''
      }
    },
    methods:{
      sendClick(){
        this.$emit('btnClick')
      }
    },
    watch:{
      searchVal(val){
        // 通过父组件进行搜索逻辑
        this.$emit('onSearch',val)
      }
    }
  }
</script>

<style  scoped>
.searchBox{
  width: 350px;
}
.searchHead{
  display: flex;
  justify-content: space-between;
  padding-right: 53px;
  margin-bottom: 20px;
}
</style>